<?php
session_start();
?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>APIcombo</title>
<link href="opmaak.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
function laadscherm()
	{
 		$('body').empty();
		$('body').append('<img src="http://www.club-connect.nl/hyvessync/images/loading.gif" title="loading" alt="loading" />')
	}
</script>
            
<body>
<?php
// Include the script that checks if WhoWhatWhere's need to be updated.
require_once('wwws.php');

// Create consumer variables needed for making calls
require_once('GenusAPIs/GenusApis.php');
$oOAuthConsumer = new OAuthConsumer("MjEwNV-jK9CigmbdQ_zJa-FU8qDy", "MjEwNV_8vv9S3vRZwSLVItIrsZwu");
$oGenusApis = new GenusApis($oOAuthConsumer);

		
		$hyvesid = $_SESSION['hyvesid'];
		
		// Make connection with database and getting data of current user
		require_once("database_inc.php");
		$db = mysqli_connect($server,$gebruikersnaam,$password);
		mysqli_select_db($db, $database);
		$sql = "SELECT * FROM users WHERE hyvesID = '$hyvesid'";
		$result = mysqli_query($db, $sql);
		$rows = mysqli_num_rows($result);
		$regel = mysqli_fetch_assoc($result);
		
		if ($rows == 0)
		{
		?>
        <div id="content">
        <div id="headert"><table><tr><td><img src="images/hyvessynclogo.png" title="HyvesSync" alt="HyvesSync" /></td><td><label class="title">HyvesSync</label></td></tr></table></div>
        <p>
        <?php
			echo 'Je hebt je nog niet geregistreerd. '; ?><a href="authorization_step1.php" onclick="laadscherm()">Klik hier</a><?php echo ' om je te registeren.' ;
			?>
        </p>
        </div>
        <?php
		}
		else
		{
		?>
        <div id="content">
        <div id="headert"><table><tr><td><img src="images/hyvessynclogo.png" title="HyvesSync" alt="HyvesSync" /></td><td><label class="title">HyvesSync</label></td></tr></table></div>
        <p>
        <?php
			
			
			echo 'Je bent geregistreerd. Welkom, '.$regel['voorNaam'].'!'; ?> Maak een keuze uit de mogelijkheden.<br /><br /><a href="google.php" onclick="laadscherm()">Agendaoverzicht</a><br /><a href="invoegen.php" onclick="laadscherm()">Voeg Google Agenda item toe</a><br /><a href="bday.php" onclick="laadscherm()">Synchroniseer de verjaardagen van je vrienden.</a><br /><a href="hoewerkthet.htm" onclick="laadscherm()">Hoe werkt het?</a>
			
        </p>
        </div>
        <?php ;
		}
	
ob_end_flush();
?>
</body>
</html>